class Person implements Cloneable{
    public int id;

    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                '}';
    }
}

public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person = new Person();
        person.id = 99;
        Person person1 = (Person)person.clone();
        person1.id = 100;
        System.out.println(person);
        System.out.println(person1);
    }
}

